home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Author: cdt
- //
- // Procedure Name:
- // buildViewMenu
- //
- // Description:
- // Builds all the items in the View menu when
- // the user clicks on the menu. Checks to see if
- // there are any children in the menu already, and
- // if so, doesn't rebuild the menu.
- //
- // Input Arguments:
- // Name of the parent menu.
- //
- // Return Value:
- // None.
- //
-
-
- global proc string saveCurrentPanelLayout() {
-
- global string $gMainWindow;
- global string $gMainPane;
- global string $gPanelEditorWnd;
- string $text = "New Layout";
- string $layoutName = "";
- string $config, $configArray[];
-
- string $result = `promptDialog
- -title "Save Panel Arrangement"
- -message "Enter Name for Arrangement:"
- -text $text
- -button "OK"
- -button "Cancel"
- -defaultButton "OK"
- -cancelButton "Cancel"
- -dismissString "Cancel"
- -parent $gMainWindow`;
-
- //
- // If the result was "OK", then proceed
- //
- if ( $result == "OK" ) {
-
- $layoutName = `promptDialog -query`;
-
- // First check if the name is unique.
- //
- $configArray = `getPanel -allConfigs`;
- for ($config in $configArray) {
- if ($layoutName == `panelConfiguration -query -label $config`) {
-
- confirmDialog
- -title "Warning"
- -message ("A layout with the name \"" + $layoutName +
- "\" already exists.\nPlease choose another.")
- -button "Close"
- -parent $gMainWindow;
- return "";
- }
- }
-
- string $newConfigName = `panelConfiguration -sc false`;
- panelConfiguration -edit -label $layoutName $newConfigName;
- updatePanelLayoutFromCurrent $layoutName;
-
- // special case for top,front,side,persp
- // -make sure they always reset their state.
- //
- int $i,$nArr;
- string $labels[];
-
- $labels = `panelConfiguration -q -labelStrings $newConfigName`;
-
- $nArr = size($labels);
- for ($i = 0; $i < $nArr; $i++) {
- if ("Persp View" == $labels[$i] ||
- "Top View" == $labels[$i] ||
- "Side View" == $labels[$i] ||
- "Front View" == $labels[$i])
- {
- panelConfiguration -e -rfs ($i+1) true $newConfigName;
- }
- }
- }
-
- return $layoutName;
- }
-
-
- global proc buildViewMenu( string $parent )
- {
- string $menu;
- setParent -m $parent;
-
- if( `menu -q -ni $parent` != 0 ) {
- //
- // Menu is already built - just return
- //
- return;
- }
-
- WindowMenu $parent;
-
- menuItem -divider true;
-
- menuItem -l "View Arrangement" -subMenu true -tearOff true;
-
- menuItem -label "Single Pane" -command "SingleViewArrangement"
- -annotation (getRunTimeCommandAnnotation("SingleViewArrangement"));
-
- menuItem -label "Two Panes Side by Side" -command "TwoSideBySideViewArrangement"
- -annotation (getRunTimeCommandAnnotation("TwoSideBySideViewArrangement"));
-
- menuItem -label "Two Panes Stacked" -command "TwoStackedViewArrangement"
- -annotation (getRunTimeCommandAnnotation("TwoStackedViewArrangement"));
-
- menuItem -label "Three Panes Split Top " -command "ThreeTopSplitViewArrangement"
- -annotation (getRunTimeCommandAnnotation("ThreeTopSplitViewArrangement"));
- menuItem -label "Three Panes Split Left" -command "ThreeLeftSplitViewArrangement"
- -annotation (getRunTimeCommandAnnotation("ThreeLeftSplitViewArrangement"));
- menuItem -label "Three Panes Split Bottom" -command "ThreeBottomSplitViewArrangement"
- -annotation (getRunTimeCommandAnnotation("ThreeBottomSplitViewArrangement"));
- menuItem -label "Three Panes Split Right" -command "ThreeRightSplitViewArrangement"
- -annotation (getRunTimeCommandAnnotation("ThreeRightSplitViewArrangement"));
-
- menuItem -label "Four Panes" -command "FourViewArrangement"
- -annotation (getRunTimeCommandAnnotation("FourViewArrangement"));
-
- menuItem -divider true;
-
- menuItem -label "Previous Arrangement"
- -annotation (getRunTimeCommandAnnotation("PreviousViewArrangement"))
- -command "PreviousViewArrangement";
- menuItem -label "Next Arrangement"
- -annotation (getRunTimeCommandAnnotation("NextViewArrangement"))
- -command "NextViewArrangement";
-
- setParent -menu ..;
-
- $menu = `menuItem -l "Saved Layouts" -subMenu true`;
- menuItem -e -pmc ("buildNamedArrangementsNow " + $menu) $menu;
- setParent -m ..;
-
- menuItem -l "Save Current Layout..."
- -annotation "Save Current Layout: Save the current layout of the panels"
- -c "SaveCurrentLayout";
-
- menuItem -divider true;
-
- menuItem -l "Frame All in All Views"
- -annotation "Frame All in All Views: Change the cameras to frame all objects in the view"
- -c "FrameAllInAllViews";
- menuItem -l "Frame Selection in All Views"
- -annotation "Frame Selection in All Views: Change the cameras to frame the selected object(s) in the view"
- -c "FrameSelectedInAllViews";
-
- menuItem -divider true;
-
- if (!`about -mac`) {
- menuItem -label "Minimize Application"
- -annotation "Minimize Application: Minimize Maya into one icon"
- -command "MinimizeApplication";
- }
-
- if (`about -mac`) {
- menuItem -label "Console Window..."
- -annotation "Console Window: Show the console window"
- -command "showWindow ConsoleWindow";
- }
-
- menuItem -label "Raise Main Window"
- -annotation "Raise Main Window: Brings main Maya window to the front of the stack"
- -command "RaiseMainWindow";
-
- menuItem -label "Raise Application Windows"
- -annotation "Raise Application Windows: Raises Maya windows in no particular order"
- -command "RaiseApplicationWindows";
- }
-